<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title" style="width: 100%;float:left">
        #if(form.actions??=='ADD')
        <li class="#(tab=='AddSystemUser'?'layui-this':'')" lay-event="AddSystemUser"><i class="layui-icon layui-icon-tabs"></i>创建新的用户帐号</li>
        #else
        <li class="#(tab=='EditSystemUser'?'layui-this':'')" lay-event="EditSystemUser"><i class="layui-icon layui-icon-tabs"></i>编辑用户帐号</li>
        #end
        <li class="#(tab=='SetUserRole'?'layui-this':'')" lay-event="SetUserRole"><i class="layui-icon layui-icon-set-sm"></i> 帐户权限</li>
    </ul>
</div>

<script>
    layui.util.event("lay-event", {
        AddSystemUser: function () {
            location.href = "AddSystemUser";
        },
        EditSystemUser: function () {
            location.href = "EditSystemUser?id=" + $(":input[name='id']").val();
        },
        SetUserRole: function () {
            if ($(":input[name='actions']").val() === 'ADD') {
                layer.msg("请先创建用户");
                return;
            }
            location.href = "SetUserRole?id=" + $(":input[name='id']").val();
        }
    });
</script>